package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entity.Comment;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CommentMapper {
    @Insert("INSERT INTO comment(id,content,created,user_id,weibo_id)VALUES (#{id},#{content},#{created},#{userId},#{weiboId})")
    int insertComment(Comment comment);
    @Delete("DELETE FROM comment WHERE id=#{cid}")
    int deleteComment(Long cid);
    @Update("UPDATE comment SET content=#{content}，created=#{created},user_id=#{userId},weibo_id=#{weiboId},WHERE id=#{id}")
    int updateComment(Comment comment);
    @Select("")
    Comment selectCommentById1();
    @Select("")
    List<Comment> selectCommentById2();
}
